# string = "https://www.baidu.com/s?wd=feapder&pn=10"
string = "https://www.baidu.com/s?wd=%E5%AE%9D%E9%B8%A1%E6%9A%B4%E9%9B%A8%E8%B7%AF%E8%BE%B9%E8%BD%A6%E8%BE%86%E8%A2%AB%E5%86%B2%E8%B5%B0&sa=fyb_n_homepage&rsv_dl=fyb_n_homepage&from=super&cl=3&tn=baidutop10&fr=top1000&rsv_idx=2&hisfilter=1"
my_list = string.split("?")  # 问号后面的叫做 “查询参数”


# list2 = my_list[1].split("&")
# wd_list = list2[0].split("=")
# params_list = list2[1].split("=")

# 查询参数的kv对是不确定数量的
diction = {}  # {}默认是空字典，而不是空集合set
for item in my_list[1].split("&"):
    list3 = item.split("=")
    diction[list3[0]] = list3[1]


# diction = dict(zip([wd_list[0],params_list[0]],[wd_list[1],params_list[1]]))
print(("url = {}/n params = {}").format(list[0],diction))